package org.example.struct.array2;

/**
 * @author liyishan
 * @date 2024/9/19 10:00
 * @apiNote
 */

public class Test02414LongestContinuousSubstring {
    public int longestContinuousSubstring(String s) {
        int res = 1;
        int cur = 1;
        for(int i = 1;i<s.length();i++){
            if(s.charAt(i) == s.charAt(i-1)+1){
                cur++;
            }else{
                cur = 1;
            }
            res = Math.max(res,cur);
        }
        return res;
    }
}
